///////////////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
#include <UI/UIManager.h>
#include <UI/Container.h>
#include <Application.h>

//-----------------------------------------------------------------------------

UIManager::UIManager()
{
	m_container = MGL_NEW Container();
}

//-----------------------------------------------------------------------------

UIManager::~UIManager()
{
	SAFE_DEL( m_container );
}

//-----------------------------------------------------------------------------

void	UIManager::Update(f32 dt)
{
	m_container->Update( dt );
}

//-----------------------------------------------------------------------------

void	UIManager::Draw()
{
	u16	screenWidth = Application::GetInstance()->GetResolutionWidth();
	u16	screenHeight = Application::GetInstance()->GetResolutionHeight();

    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    gluOrtho2D(0, screenWidth, 0, screenHeight);
    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();

	glTranslatef(0.0f, (f32)screenHeight, 0.0f);

	glPushMatrix();

	m_container->Draw();

    glPopMatrix();
}

//-----------------------------------------------------------------------------

Container*	UIManager::GetContainer()
{
	return m_container;
}

//-----------------------------------------------------------------------------
///////////////////////////////////////////////////////////////////////////////
